using net_work.Data.DTO.Appr;
using net_work.Data.Entity.Appr;

namespace net_work.IRepository.Appr;

public interface IFlowRepository : IRepository<Flow>
{
    /// <summary>
    /// 插入流程
    /// </summary>
    /// <param name="flowAddRequest">插入流程</param>
    /// <returns>新增的流程id</returns>
    Task<long> InsertAsync(FlowAddRequest flowAddRequest);

    /// <summary>
    /// 更新流程信息
    /// </summary>
    /// <param name="flowUpdateRequest">更新流程信息</param>
    /// <returns>是否成功</returns>
    Task<bool> UpdateAsync(FlowUpdateRequest flowUpdateRequest);
    
    /// <summary>
    /// 发布流程
    /// </summary>
    /// <param name="flowId">流程id</param>
    /// <returns>是否成功</returns>
    Task<bool> ReleaseFlow(long flowId);

    /// <summary>
    /// 验证流程是否可以提交
    /// </summary>
    /// <param name="flowId">流程id</param>
    /// <returns>是否可以提交</returns>
    Task<bool> ValidateFlowAsync(long flowId);
}